﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SemPlayGen.Logic;
using SemPlayGen.Repository.Repositories;
using SemPlayGen.DataModel;

namespace SemPlayGen.Website
{
    public partial class SongList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IEnumerable<Songs> songsList = new SongsRepository().GetAll();
                gvPlaylist.DataSource = songsList;
                gvPlaylist.DataBind();
                Songs s = new Songs();
            }
        }

        protected void btnRefreshSemantics_Click(object sender, EventArgs e)
        {
            Semantics.SynchronizeWithDB(new SongsRepository().GetAll().ToList());

            lblStatus.Text = "Успешно синхронизирана семантиката";
        }
    }
}